package com.woniuxy.commons.service.sale.factory;

import com.woniuxy.commons.entity.sale.vo.sale.SoAccountVo;
import com.woniuxy.commons.result.Result;
import com.woniuxy.commons.service.sale.SaleService;
import feign.hystrix.FallbackFactory;
import org.springframework.stereotype.Component;

/**
 * <P> @Author: ideaAdmin
 * <P> TODO: Class
 * <P> TODO: 销售模块的服务降级处理
 * <P> Date: 2022/4/22:14:51
 * <P> Description:
 */
@Component
public class SaleServiceFactory implements FallbackFactory<SaleService> {
    @Override
    public SaleService create(Throwable throwable) {
        return new SaleService(){

            @Override
            public Result get() {
                return Result.fail().message("请稍后");
            }

            @Override
            public Result findSoAccountAll(Integer currentPage, Integer limit, SoAccountVo soAccountVo) {
                return Result.fail().message("请稍后");
            }

            @Override
            public Result findChooseProduceBySoId(Integer soId, Integer currentPage, Integer limit) {
                return Result.fail().message("请稍后");
            }

            @Override
            public Result findSoAccountById(SoAccountVo soAccountVo) {
                return Result.fail().message("请稍后");
            }
        };
    }
}
